package com.bxait.toymail.order.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.bxait.com.to.mq.SecKillOrderTo;
import com.bxait.com.utils.PageUtils;
import com.bxait.com.utils.R;
import com.bxait.toymail.order.entity.OrderEntity;
import com.bxait.toymail.order.vo.OrderConfirmVo;
import com.bxait.toymail.order.vo.OrderSubmitVo;
import com.bxait.toymail.order.vo.PayVo;
import com.bxait.toymail.order.vo.SubmitOrderResponseVo;

import java.util.Map;
import java.util.concurrent.ExecutionException;

/**
 * 订单
 *
 * @author chen
 * @email 2277411582@qq.com
 * @date 2023-03-13 22:15:35
 */
public interface OrderService extends IService<OrderEntity> {

    PageUtils queryPage(Map<String, Object> params);

    // 处理购物车结算请求
    OrderConfirmVo confirmOrder() throws ExecutionException, InterruptedException;

    // 下单
    SubmitOrderResponseVo submitOrder(OrderSubmitVo vo);

    // 支付功能的实现，获取当前订单的支付信息
    PayVo getOrderPay(String orderSn);

    // 分页查询当前登录用户的所有订单
    PageUtils queryPageWithItem(Map<String, Object> params);


    R listWithItem(Map<String, Object> page);

    OrderEntity getOrderByOrderSn(String orderSn);

    // 关单
    void closeOrder(OrderEntity entity);

    // 秒杀创建订单
    void createSecKillOrder(SecKillOrderTo secKillOrder);
}

